﻿using System.Configuration;

namespace UpdateApp.Config
{
    /// <summary>
    /// Config
    /// </summary>
    internal class Config
    {
        /// <summary>
        /// 下载链接
        /// </summary>
        public string? DownloadUrl => ConfigurationManager.AppSettings["download_url"];

        /// <summary>
        /// 下载请求方式,只支持POST、GET
        /// </summary>
        public string? MethodType => ConfigurationManager.AppSettings["downlad_type"]?.ToUpperInvariant();

        /// <summary>
        /// 待更新程序名称，带后缀；比如: eson.exe
		/// 待更新程序必须与此更新程序同一路径，切记
        /// </summary>
        public string? UpdateApp => ConfigurationManager.AppSettings["update_app"];

        /// <summary>
        /// 更新版本号
        /// </summary>
        public string? Version => ConfigurationManager.AppSettings["version"];

        /// <summary>
        /// 版本相关信息获取URL
        /// </summary>
        public static string? VersionUrl { get; set; } = ConfigurationManager.AppSettings["version_url"];
    }
}
